---
--类名: SkipStoryConfirm.lua
--创建日期: 2016-2-3
--创建人: 陈小虎
--功能描述: 跳过操作视图
--修改内容:
--修改日期:   
--修改人:     
--修改备注: 
--
local SkipStoryConfirm = class("SkipStoryConfirm",function()
    return display.newLayer("SkipStoryConfirm")
end)

function SkipStoryConfirm:ctor(maskHeight)
	self:setTouchEnabled(false)

	local uiNode = cc.uiloader:load(Res.SkipConfirmUi)
    uiNode:setContentSize(display.width,display.height)
    ccui.Helper:doLayout(uiNode)
    self:addChild(uiNode)

    self.mUINode = uiNode


    -- self:playSkipAction()

    -- self:addSkipListener()

    self:addButtonsListener()

    self:setNodeEventEnabled(true)
end

function SkipStoryConfirm:onEnter()

end

function SkipStoryConfirm:onExit()

end

function SkipStoryConfirm:setOkCallback(okCall)
	self.mOkCall = okCall
end

function SkipStoryConfirm:setCancelCallback(cancelCall)
	self.mCancelCall = cancelCall
end

function SkipStoryConfirm:okCall()
	if self.mOkCall then
		self.mOkCall()
	end
end

function SkipStoryConfirm:cancelCall()
	if self.mCancelCall then
		self.mCancelCall()
	end
end

function SkipStoryConfirm:addButtonsListener()
	local btnOk = self.mUINode:findChild("skip/Button_queding")
	local btnCancel = self.mUINode:findChild("skip/Button_quxiao")
	if btnCancel then
		btnCancel:setVisible(false)
		btnCancel:addClickEventListener(function(sender)
			self:cancelCall()
		end)
	end

	btnOk:addClickEventListener(function(sender)
		self:okCall()
	end)
end

return SkipStoryConfirm